package com.NetWork.Encoder;

import com.google.gson.GsonBuilder;

public class JsonEncoder {
    private static final GsonBuilder gb = new GsonBuilder();

    static {
//不需要html escape
        gb.disableHtmlEscaping();
    }

    //序列化：使用Gson将 POJO 转成字符串
    public static String pojoToJson(java.lang.Object obj) {
        return gb.create().toJson(obj);
    }
}
